<template>
	<view>

		<u-navbar title="详情" :autoBack="true" :placeholder="true"></u-navbar>


		<view style="padding:100rpx 20rpx 20rpx;background-color: #fff;">
			<view style="margin-bottom: 50rpx;">
				{{data(data1)}}
			</view>
			<u-parse :content="single" :tagStyle="style"></u-parse>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				single: '',
				style: {
					p: 'text-align:center;'
				},
				data1: null
			}
		},
		async onLoad(optcion) {
			let res = await this.$api.getartcle({})
			let res1 = res.data.filter(v => v.id == optcion.id)
			this.data1 = res1[0].createtime
			this.single = res1[0].cont
			console.log(this.single);
		},
		methods: {
			data(v) {
				console.log(v);
				let date = new Date(parseInt(v * 1000))
				console.log(date);
				// let date = new Date(parseInt(timestamp) * 1000)
				let Year = date.getFullYear()
				let Moth =
					date.getMonth() + 1 < 10 ?
					"0" + (date.getMonth() + 1) :
					date.getMonth() + 1
				let Day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate()
				let Hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours()
				let Minute =
					date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()
				let Sechond =
					date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds()
				let GMT =
					Year +
					"-" +
					Moth +
					"-" +
					Day +
					"   " +
					Hour +
					":" +
					Minute +
					":" +
					Sechond
				return GMT
			},

		}
	}
</script>

<style>
</style>